include $(GOROOT)/src/Make.$(GOARCH)

PDFMODIFY = perl pdfmodi.pl
PDFREADER = ../pdfreader
PIGGY = *.$O DEADJOE test.pdf
ALL=redact

all: $(ALL)

procedere:
	( cd test2 ; make )
	perl redact.pl test1 test2 test.dvi \
	| perl red2pdfm.pl > test.pdfm

# Using pdfmodify 2.0 (from Sanface Software, a 2003 beta version, never
# sold explicitely) to get the result - this is a testing stub only and will
# be replaced by a program written in Go, contact me if you have any
# problems, I'm basically the author of this pdfmodify and can give you a
# license until the things are fixed:
test.pdf: procedere
	$(PDFMODIFY) -t test2/test.pdf -o test.pdf -i test.pdfm

%: %.$O
	$(LD) -o $* $*.$O

%.$O: %.go
	$(GC) -I. -I$(PDFREADER) $*.go

depend:
	$(PDFREADER)/mkdepend *.go <Makefile >mkf.new && \
	mv -f Makefile Makefile~ && \
	mv -f mkf.new Makefile
clean:
	-rm *~

distclean: clean
	-rm $(ALL) $(PIGGY)
	-( cd test2 ; make distclean )

# -- depends --
